﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AcceptnaceTests
{
    public static class TestUtils
    {
        private static int uid = 1000;
        private static int mid = 1000;
        private static int tid = 1000;
        private static int sid = 1000;
        private static int cid = 1000;
        private static Object myLock = new Object();

        public static string GetNextUsername()
        {
            string result;
            lock(myLock)
            {
                result = "username" + (++uid);
            }
            return result;
        }

        public static string GetCurrentUsername()
        {
            string result;
            lock(myLock)
            {
                result = "username" + uid;
            }
            return result;
        }

        public static string GetNextMember()
        {
            string result;
            lock(myLock)
            {
                result = "member" + (++mid);
            }
            return result;
        }

        public static string GetCurrentMember()
        {
            string result;
            lock(myLock)
            {
                result = "member" + mid;
            }
            return result;
        }

        public static string GetNextTopic()
        {
            string result;
            lock(myLock)
            {
                result = "topic" + (++tid);
            }
            return result;
        }

        public static string GetCurrentTopic()
        {
            string result;
            lock(myLock)
            {
                result = "topic" + tid;
            }
            return result;
        }

        public static string GetNextSubject()
        {
            string result;
            lock(myLock)
            {
                result = "subject" + (++sid);
            }
            return result;
        }

        public static string GetCurrentSubject()
        {
            string result;
            lock(myLock)
            {
                result = "subject" + sid;
            }
            return result;
        }

        public static string GetNextContent()
        {
            string result;
            lock(myLock)
            {
                result = "content" + (++cid);
            }
            return result;
        }

        public static string GetCurrentContent()
        {
            string result;
            lock(myLock)
            {
                result = "content" + cid;
            }
            return result;
        }

        public static string GetContent()
        {
            return "content";
        }

        public static string GetPassword()
        {
            return "password";
        }

        public static string GetNewPassword()
        {
            return "new_password";
        }

        public static string GetAdminUsername()
        {
            return "admin";
        }

        public static string GetAdminPassword()
        {
            return "admin";
        }
    }
}
